home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / NWDPMI.PA1 < prev    next >
Text File  |  1994-01-14  |  4KB  |  94 lines

  1. {#Z+}
  2. (*(10U&l12D(s4099T&k2S*)
  3. {***************************************************************************}
  4. {** Program : NWDPMI                                                      **}
  5. {***************************************************************************}
  6. {** Version : 1.53            ** Started : 11/11/91  ** Ended :   /  /    **}
  7. {***************************************************************************}
  8. {******************************** Description ******************************}
  9. {***************************************************************************}
  10. {** DPMI library for Netware API                                          **}
  11. {**                                                                       **}
  12. {**                                                                       **}
  13. {**                                                                       **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {***************************************************************************}
  17. {******************************** Information ******************************}
  18. {***************************************************************************}
  19. {** Provides DPMI Services                                                **}
  20. {**                                                                       **}
  21. {**                                                                       **}
  22. {**                                                                       **}
  23. {** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED.    **}
  24. {** Portions (c) Novell Inc,                                              **}
  25. {**                                                                       **}
  26. {**                                                                       **}
  27. {***************************************************************************}
  28.  
  29. {$I NETWARE.INC}
  30. {#Z-}
  31.  
  32. UNIT NWDPMI;
  33.  
  34. Interface
  35.  
  36. const
  37.  
  38.   MaxBufferSize      = 520;
  39.   { The maximum buffer size allowed in the request/receive buffers }
  40.  
  41. Type
  42.  
  43.   PRealModeRegisters = ^TRealModeRegisters;
  44.   TRealModeRegisters = Record
  45.  
  46.                          Case Integer Of
  47.  
  48.                            0 : {32 bit registers}
  49.  
  50.                                (EDI, ESI, EBP, EXX, EBX, EDX, ECX, EAX : LongInt;
  51.                                 Flags, ES, DS, FS, GS, IP, CS, SP, SS : word);
  52.  
  53.                            1 : {16 bit registers}
  54.  
  55.                                (DI, DIH, SI, SIH, BP, BPH, XX, XXH : WORD;
  56.  
  57.                                 CASE INTEGER OF
  58.  
  59.                                   0 :
  60.  
  61.                                       (BX, BXH, DX, DXH, CX, CXH, AX, AXH : WORD);
  62.  
  63.                                   1 :
  64.  
  65.                                       (BL, BH, BLH, BHH, DL, DH, DLH, DHH,
  66.                                        CL, CH, CLH, CHH, AL, AH, ALH, AHH : BYTE));
  67.  
  68.                        END;
  69.  
  70.  
  71.   PBuffer  = ^TBuffer;
  72.   TBuffer  = ARRAY [0 .. MaxBufferSize] OF BYTE;
  73.   TDualPtr = record
  74.  
  75.                RealPtr : PBuffer;
  76.                ProtPtr : PBuffer;
  77.                Result  : longint;
  78.  
  79.              end;
  80.  
  81. function SimRealModeInt (IntNumber : Byte; StackCopy : word;
  82.                          var Regs : TRealModeRegisters) : boolean;
  83.  
  84. function CallRealModeProc (CallerID, DestID, DestFunc : word;
  85.                            var Regs) : boolean;
  86.  
  87. {StackCopy = number of words to copy from protected mode stack to real mode stack
  88.  If none needed pass in 0}
  89.  
  90. procedure AllocBuf (var P : TDualPtr; Size : word);
  91.  
  92. procedure ReleaseBuf (var P : TDualPtr; Size : word);
  93.  
  94.